package sel.me.spring.boot159.web.component;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

/**
 * @author shenenlu 2021年04月26日 下午14:26:58
 */
@Component
public class InnerEurekaRestApiInvoker {

    @Autowired
    @Qualifier("eurekaRestTemplate")
    private RestTemplate eurekaRestTemplate;


    public String getHello(){
        return eurekaRestTemplate.getForEntity("http://aaa.com", String.class).getBody();
    }

    public String getError() {
        return "hello,sorry,error!";
    }

}
